type KebabCase<
  S extends string,
  U extends string = ""
> = S extends `${infer F}${infer Rest}`
  ? F extends Lowercase<F>
    ? `${F}${KebabCase<Rest, `-`>}`
    : `${U}${Lowercase<F>}${KebabCase<Rest, `-`>}`
  : S;

type Sss = KebabCase<"Foo-Bar">;
